<?php
header('Content-Type:text/html;charset=utf-8');
define('MEMORY_LIMIT_ON',function_exists('memory_get_usage'));
define('DATA_PATH', './data/'); //表字段缓存目录
define('APP_DEBUG', true);
if(!defined('IN_CORE')){
	exit('No permission resources.');
}
date_default_timezone_set('PRC');
//   系统信息
if(version_compare(PHP_VERSION,'5.4.0','<')) {
	ini_set('magic_quotes_runtime',0);
	define('MAGIC_QUOTES_GPC',get_magic_quotes_gpc()?True:False);
}else{
	define('MAGIC_QUOTES_GPC',false);
}
define('APP_CORE', './core');
define('IS_CGI',substr(PHP_SAPI, 0,3)=='cgi' ? 1 : 0 );
define('IS_WIN',strstr(PHP_OS, 'WIN') ? 1 : 0 );
define('IS_CLI',PHP_SAPI=='cli'? 1   :   0);
//$database = include_once './core/database.inc.php';
$database = include_once '../application/config/database.inc.php';
define('DB_TYPE', 'mysql');
define('DB_HOST', $database['default']['hostname']);
define('DB_NAME', $database['default']['database']);
define('DB_USER', $database['default']['username']);
define('DB_PWD', $database['default']['password']);
define('DB_PREFIX', $database['default']['tablepre']);
define('DB_CHARSET', $database['default']['charset']);
define('G_BANBEN_NUMBER',3);

require './core/common.php';
require './core/functions.php';
require './core/api.func.php';
require './core/pay.func.php';

//自动载入类
function __autoload($className){
	if(file_exists('./core/Dbdriver/'.$className.'.class.php')){
		require './core/Dbdriver/'.$className.'.class.php';
	}elseif (file_exists('./core/'.$className.'.class.php')){
		require './core/'.$className.'.class.php';
	}
}

// $info = M('link')->where(array('name' => '测试'))->select();
// print_r($info);